package com.sun.demo.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//Rest模式
@RestController
@RequestMapping("/books")
public class BookController {

    @Value("${lession}")
    private String lessonName;

    @Value("${server.port}")
    private int port;

    @Value("${enterprise.subject[1]}")
    private String[] subject_01;

    @GetMapping
    public String getById(){
        System.out.println("springboot is running...");
        System.out.println(lessonName+"--"+port+"----"+subject_01);
        return "springboot is running...";
    }
}